﻿using System.Web.Mvc;

namespace Mvc4.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Admin_Sites",
                "Admin/Sites",
                new { controller = "Site", action = "Index" }
            );
            context.MapRoute(
                "Admin_Create",
                "Admin/Site/Create",
                new { controller = "Site", action = "Create", id = "" }
            );
            context.MapRoute(
                "Admin_Site",
                "Admin/Site/{id}",
                new { controller = "Site", action = "Edit", id = "" }
            );
            context.MapRoute(
                "Admin_NewsSites",
                "Admin/NewsSites/{id}",
                new { controller = "Site", action = "FriendSites", id = "" }
            );
            context.MapRoute(
                "Admin_Attributes",
                "Admin/Attributes/{id}",
                new { controller = "Site", action = "SiteAttributes", id = "" }
            );
            context.MapRoute(
                "Admin_User",
                "Admin/Users",
                new { controller = "User", action = "Index" }
            );
            context.MapRoute(
                "Admin_Reports",
                "Admin/Reports",
                new { controller = "Report", action = "Index" }
            );
            context.MapRoute(
                "Admin_Day",
                "Admin/Reports/DayGoods",
                new { controller = "Report", action = "DayGoods" }
            );
            context.MapRoute(
                "Admin_Month",
                "Admin/Reports/MonthGoods",
                new { controller = "Report", action = "MonthGoods" }
            );
            context.MapRoute(
                "Admin_Year",
                "Admin/Reports/YearGoods",
                new { controller = "Report", action = "YearGoods" }
            );
            context.MapRoute(
                "Admin_Inap",
                "Admin/Reports/InapContents",
                new { controller = "Report", action = "InapContents" }
            );
            context.MapRoute(
                "Admin_BlockUser",
                "Admin/BlockUser",
                new { controller = "User", action = "BlockUser" }
            );
            context.MapRoute(
                "Admin_Configuration",
                "Admin/Configuration",
                new { controller = "Configuration", action = "Edit" }
            );
            context.MapRoute(
                "Error",
                "Admin/{*url}",
                new { controller = "Site", action = "Error" }
            );
            /*context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { controller = "Site", action = "Index", id = UrlParameter.Optional }
            );*/
        }
    }
}
